package com.foreknow.elmboot.service;

import com.foreknow.elmboot.po.DeliveryAddress;
import com.foreknow.elmboot.po.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.sql.SQLException;
import java.util.List;

public interface DeliveryAddressService {
    /**
     * 根据用户查询地址
     * @param userId
     * @return
     * @throws SQLException
     */
    public List<DeliveryAddress> listDeliveryAddressByUserId(String userId);

    /**
     * 根据主键查询地址
     * @param daId
     * @return
     */
    public DeliveryAddress getDeliveryAddressById(Integer daId);

    /**
     * 新增地址
     * @param deliveryAddress
     * @return
     */
    public int saveDeliveryAddress(DeliveryAddress deliveryAddress);

    /**
     * 修改地址
     * @param deliveryAddress
     * @return
     */
    public int updateDeliveryAddress(DeliveryAddress deliveryAddress);

    /**
     * 根据Id删除地址
     * @param daId
     * @return
     */
    public int removeDeliveryAddress(Integer daId);
}
